
 
                               
 DEFINE VARIABLE i AS INTEGER.
 DEFINE VARIABLE s AS CHARACTER.
 
 OUTPUT TO c:\a.txt .

 FOR EACH pt_mstr NO-LOCK WHERE pt_part_type = "P500" OR pt_part_type = "P000" WITH STREAM-IO WIDTH 132:

     i = 0.
     s = "".

     FOR EACH pc_mstr NO-LOCK WHERE pc_part = pt_part AND (pc_start = ? OR pc_start <= TODAY) AND (pc_expire = ? OR pc_expire >= TODAY) BREAK BY pc_list :
         IF FIRST-OF(pc_list) THEN DO:
             i = i + 1.
             s = s + pc_list + ",".
         END.
             
     END.

     IF i = 1 THEN
         DISPLAY pt_part i SUBSTRING(s, 1, LENGTH(s) - 1) FORMAT "x(8)" pt_desc1 + pt_desc2 FORMAT "x(80)".
     



 END.
